<template>
	<view class="wrap">

		<image src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/user/order/6.png" class="bg-set"
			mode=""></image>

		<view class="avatar">
			<view class="photo">
				<image class="img" src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/user/order/4.png"
					mode=""></image>
				<view class="name">
					{{info.vip_name}}
				</view>
			</view>

			<view class="price">
				<text class="unit">¥</text>
				<text class="money">{{info.price}}</text>
			</view>
		</view>
		<view class="list">
			<view class="item">
				<view class="top">
					
					
					<!-- // 0 1 2 -->
					
					
					<view v-if="info.status==1" class="right">
						<image class="status"
							src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/user/order/3.png"
							mode="">
						</image>
						<!-- <!-- 支付状态 0未支付 1支付成功 2支付失败 -->
						<text>{{statusList[info.status]}}</text>
					</view>
					<view  v-else-if="info.status==0" class="right">
						<image class="status"
							src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/user/order/2.png"
							mode="">
						</image>
						<text style="color: #FFC01F;">{{statusList[info.status]}}</text>
					</view>
					
					<view v-else class="right">
						<image class="status"
							src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/fail.png"
							mode="">
						</image>
						<text style="color: red;">{{statusList[info.status]}}</text>
					</view>
					
<!-- 
					<view v-if="info.status == 1" class="right">
						<image class="status"
							src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/user/order/3.png"
							mode="">
						</image>
						<text>{{statusList[item.status]}}</text>
					</view>
					<view v-else class="right">
						<image class="status"
							src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/user/order/2.png"
							mode="">
						</image>
						<text style="color: #FFC01F;">待支付</text>
					</view> -->
				</view>
				<view class="bot">
					<view class="li">
						支付金额：{{info.price}}元
					</view>
					<view class="li">
						交易类型：{{info.payWay}}
					</view>
					<view class="li">
						订单编号：{{info.order_no}}
				
						
						<image @click.stop="copy(item.order_no)" class="copy"
							src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/user/order/5.png" mode=""></image>
					</view>
					<view class="li">
						创建时间：{{info.createTime}}
					</view>
					<view v-if="info.payTime" class="li">
						支付时间：{{info.payTime}}
					</view>
				</view>
			</view>
			<view class="serviceCont" @click="contastUs()">
				有问题请联系客服
				<view class="service">

					联系客服
				</view>
			</view>
		</view>

	</view>
</template>
<script>
	export default {

		data() {
			return {
				info: {},
				statusList:['未支付','支付成功','支付失败'],
			}
		},
		onLoad(e) {
			uni.showLoading({
				title: "加载中...",
			})
			this.getDetai(e)
		},
		
		mounted() {
			uni.hideLoading()
		},
		methods: {
			copy(val) {
				uni.setClipboardData({
					data: val, // 必须字符串
					success: function() {
						uni.showToast({
							icon: 'none',
							title: '复制成功'
						});
			
					}
				});
			},
			getDetai(e){
				this.$u.api.mine.order_info({
					appletId: this.vuex_appletId,
					orderId:e.id
				}).then(res => {
					this.info = res.data.orderInfo
				})
			},
			// 联系我们
			contastUs() {
				// 获取联系我们客服地址
				this.$u.api.mine.getCustomerUrl().then(res => {
					if (res.code != 200) {
						this.$u.toast(res.msg)
						return
					}
					
					uni.navigateTo({
						url:'/subpackMain/user/webview?url=' + res.data.customerUrl
					})
					
				})
			},
		}
	};
</script>
<style scoped lang="scss">
	.wrap {
		margin: 0 32rpx;

		.bg-set {
			width: 100%;
			height: 54rpx;
			display: block;
		}

		.serviceCont {
			position: fixed;
			bottom: 30px;
			left: 32rpx;
			right: 32rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 28rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 300;
			color: #737B9A;
			line-height: 33rpx;
			.service {
				width: 185rpx;
				height: 72rpx;
				background: #16AC51;
				border-radius: 68rpx 68rpx 68rpx 68rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 33rpx;
			}
		}



		.list {
			margin-top: 32rpx;

			.item {
				margin-bottom: 32rpx;
				padding: 0 32rpx;
				background: rgba(45, 48, 85, 0.35);
				border-radius: 20rpx 20rpx 20rpx 20rpx;

				.bot {
					padding: 20rpx 0;
					line-height: 49rpx;
					font-size: 22rpx;
					font-family: HYQiHei-45S, HYQiHei;
					font-weight: normal;
					color: #FFFFFF;

					.li {
						display: flex;
						align-items: center;

					}

					.copy {
						width: 30rpx;
						height: 30rpx;
						margin-left: 15rpx;
					}
				}

				.top {
					padding: 32rpx 0 20rpx 0;
					border-bottom: 1rpx solid rgba(115, 123, 154, 0.3);
					display: flex;
					align-items: center;

					justify-content: center;

					.left {
						display: flex;
						align-items: center;

						.icon {
							width: 38rpx;
							height: 40rpx;
						}

						text {
							font-size: 30rpx;
							font-family: PingFang HK-Light, PingFang HK;
							font-weight: 300;
							color: #FFFFFF;
							margin-left: 10rpx;
						}
					}

					.right {
						display: flex;
						align-items: center;

						.status {
							width: 32rpx;
							height: 32rpx;
							margin-right: 13rpx;
						}

						text {
							font-size: 24rpx;
							font-family: PingFang HK-Light, PingFang HK;
							font-weight: 300;
							color: #03DACE;
						}
					}

				}
			}
		}

		.title {
			font-size: 36rpx;
			font-family: PingFang SC-Light, PingFang SC;
			font-weight: 300;
			color: #FFFFFF;
			line-height: 42rpx;
		}

		.avatar {
			width: 702rpx;
			height: 100rpx;
			background: url("https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/FireAndFire/user/order/7.png") no-repeat;
			background-size: cover;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 44rpx 0 52rpx;

			.photo {
				display: flex;
				align-items: center;

				.name {
					font-size: 30rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #FFFFFF;
					line-height: 35rpx;
				}

				.img {
					width: 47rpx;
					height: 38rpx;
					margin-right: 8rpx;

				}


			}

			.price {
				display: flex;
				align-items: flex-end;

				.unit {
					font-size: 39rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #B6FF6D;
					line-height: 55rpx;
					margin-right: 15rpx;
				}

				.money {
					font-size: 57rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 300;
					color: #B6FF6D;
					line-height: 67rpx;
				}
			}

		}
	}
</style>
